package org.example.service;


import org.example.domain.Demo;
import org.example.domain.DemoExample;
import org.example.mapper.DemoMapper;
import org.springframework.stereotype.Service;

import jakarta.annotation.Resource;
import java.util.List;

/**
 * Demo服务类，封装Demo表业务逻辑
 */
@Service
public class DemoService {
    @Resource
    private DemoMapper demoMapper;

    /**
     * 查询所有Demo数据
     * @return Demo列表
     */
    public List<Demo> list() {
        DemoExample example = new DemoExample();
        // 按ID升序排列
        example.setOrderByClause("id ASC");
        return demoMapper.selectByExample(example);
    }
}